#include <AVUIGeometry.h>

namespace AVUI {

class StreamGeometryContext;
class StreamGeometryStream;

class StreamGeometry : public Geometry
{
    friend class StreamGeometryContext;
public:
    DECLARE_ELEMENT(StreamGeometry, Geometry);

    DECLARE_DEPENDENCY_PROPERTY(FillRule);
    FillRule::Enum get_FillRule() { return (FillRule::Enum)(AVUI::UnboxValue<int>(GetValue(get_FillRuleProperty()))); }
    void set_FillRule(FillRule::Enum value) { SetValue(get_FillRuleProperty(), AVUI::BoxValue<int>(value)); } 


    TRefCountedPtr<StreamGeometryContext> Open();

    virtual Rect GetBounds();
    virtual bool HitTest(const Point& pt, int hitTestFlags, float strokeThickness);

protected:

    virtual TRefCountedPtr<Freezable> CreateInstanceCore() AVUI_OVERRIDE { return object_allocate<StreamGeometry>().get_Ptr(); }

private:
    static void StaticConstructor();

    virtual void BuildGeometry(GeometryBuilder* pGB);
    void BuildGeometryCommon(GeometryBuilder* pGB);

    void set_GeometryStream(StreamGeometryStream* pStream) { m_pGeometryStream = pStream; }

    TRefCountedPtr<StreamGeometryStream> m_pGeometryStream;

};


}; // namespace AVUI
